package com.bw.mapper;

import com.bw.bean.Shop;
import com.bw.bean.Vo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: lhy
 * @Date: 2025/3/12 09:06
 * @Description:
 **/
@Mapper
public interface VoMapper {
    @Select("call prco1")
    double getList1();
    @Select("select s.name, count(oi.rating) value\n" +
            "from shop s\n" +
            "         left join order_info oi on s.id = oi.shop_id and oi.rating=5\n" +
            "group by s.name;")
    List<Vo> getList2();
    @Select("select b.name, sum(amount) value\n" +
            "from base_province b\n" +
            "         left join payment p on b.region_id = p.id\n" +
            "group by b.name;")
    List<Vo> getList3();
@Select("select *\n" +
        "from base_province b\n" +
        "       left join shop s on b.region_id = s.region_id\n" +
        "         left join order_info oi on b.id = oi.province_id and oi.status=2;")
    default List<Shop> getList4() {
        return null;
    }
@Select("  @RequestMapping(\"List4\")\n" +
        "    public List<Shop> getList4(){\n" +
        "\n" +
        "        return voService.getList4();\n" +
        "    }\n" +
        "    ")
    default List<Vo> getList5() {
        return null;
    }
@Select("select s.name,sum(actual_amount) value\n" +
        "from shop s\n" +
        "left join order_info oi on s.id = oi.shop_id and s.name='Bess Twishes'\n" +
        "group by s.name limit 1;")
    default List<Vo> getList6() {
        return null;
    }
}
